Skip to content

Fix #99684 through autoref in write! macro with a two-phased borrows retrocompat workaround#100202

Closed
danielhenrymantilla wants to merge 3 commits intorust-lang:masterfrom
danielhenrymantilla:fix-99684-self-in-write-dropped-early
Closed

Fix #99684 through autoref in write! macro with a two-phased borrows retrocompat workaround#100202
danielhenrymantilla wants to merge 3 commits intorust-lang:masterfrom
danielhenrymantilla:fix-99684-self-in-write-dropped-early

Conversation

@danielhenrymantilla
Copy link
Contributor

@danielhenrymantilla danielhenrymantilla commented Aug 6, 2022

Fixes #99684, using the idea suggested over #99684 (comment) by @eddyb, and implemented by @dtolnay to test its viability.

On top of that, it does use a two phased borrows retrocompat workaround (imho, the write! family of macros supporting two-phased borrows to begin with is quite surprising —could we have a FCW against it?).

  • For those currently really wanting two-phased borrows semantics, it's easy to rewrite the code so that it fits the special rule (use a new binding for the target of write!);

EDIT: as it is implemented now, it should be quite robust and tackle the expected semantics 🙂

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

regression: "self" in writeln! drops too early

9 participants